package com.itheima.config;


import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;

public class JDBCConfig {
    @Bean("dataSource")
    public static DruidDataSource getDataSource(){
        DruidDataSource dataSource=new DruidDataSource();
        dataSource.setDriverClassName("com.mysql.jdbc.Driver");
        dataSource.setUrl("jdbc:mysql://localhost:3306/day01");
        dataSource.setUsername("root");
        dataSource.setPassword("root");
        return dataSource;
    }



}
